#!/bin/bash - 
#===============================================================================
#
#          FILE: groupsend_plot.sh
# 
#         USAGE: ./groupsend_plot.sh 
# 
#   DESCRIPTION: 
# 
#       OPTIONS: ---
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: YOUR NAME (), 
#  ORGANIZATION: 
#       CREATED: 03.05.2013 12.26.46 EEST
#      REVISION:  ---
#===============================================================================

set -o nounset                              # Treat unset variables as an error
echo 'set terminal epslatex color colortext
  set output "groupsend_plot_inaf.tex"
  set ylabel "Network total speed (Mb/s)"
  set xlabel "Time(s)"
  set key right bottom
  f(x) = mean_y
  fit f(x) "data/ultimate_tcp_watt_to_inaf_1_stream_recv" u 1:2 via mean_y
  set label 3 gprintf("Mean = %gMb/s", mean_y) at  5,1000
  fit f(x) "data/ultimate_tcp_watt_to_inaf_4_stream_recv" u 1:2 via mean_y
  set label 4 gprintf("Mean = %gMb/s", mean_y) at  15,2000
  fit f(x) "data/ultimate_tcp_watt_to_inaf_16_stream_recv" u 1:2 via mean_y
  set label 5 gprintf("Mean = %gMb/s", mean_y) at  25,3000
  fit f(x) "data/ultimate_tcp_watt_to_inaf_64_stream_recv" u 1:2 via mean_y
  set label 6 gprintf("Mean = %gMb/s", mean_y) at  35,4000
  plot "data/ultimate_tcp_watt_to_inaf_1_stream_recv" u 1:2 title "1 Stream"  w l , \
  "data/ultimate_tcp_watt_to_inaf_4_stream_recv" u 1:2 title "4 Stream"  w l , \
  "data/ultimate_tcp_watt_to_inaf_16_stream_recv" u 1:2 title "16 Stream"  w l , \
  "data/ultimate_tcp_watt_to_inaf_64_stream_recv" u 1:2 title "64 Stream"  w l , \' | gnuplot -persist

